using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UpgradeBayonet:Upgrade {

	float timeAfterActivation;

	public override void Update(object sender,WeaponEventArgs e) {
		base.Update(sender,e);
		timeAfterActivation+=deltaTime;
		if(timeAfterActivation>1) timeAfterActivation=1;
		if(timeAfterActivation<1) AddProgression(timeAfterActivation);
	}

	protected override void ShootingEventHandler(object _sender,ShootEventArgs e) {
		base.ShootingEventHandler(_sender,e);
		if(!IfReactWeaponEvent(_sender,e)) return;
		if(timeAfterActivation>=1) {
			timeAfterActivation=0;
			weapon.weapon.ShootFromMuzzle(ProjectileData.nameToData["MeleePierce"],new Dictionary<int,int>());
		} else {
			timeAfterActivation+=0.1f;
		}
	}

}
